package com.richinfo.buddy.oauthserver.model.security;


import org.springframework.security.core.authority.AuthorityUtils;
import org.springframework.security.core.userdetails.User;

import com.richinfo.buddy.oauthserver.model.entity.MyUserEntity;


/**
 * Security User
 * 
* Created by WangXJ
* 2019-04-11 16:24
*/
public class SecurityUser extends User{
	
	private MyUserEntity user;

	public SecurityUser(MyUserEntity suser) {
		super(
				suser.getUserName(),
				suser.getPassword(),
				true,
				true,
				true,
				true,
				AuthorityUtils.commaSeparatedStringToAuthorityList("admin")
		);
		user = suser;
	}

	public MyUserEntity getUser() {
		return user;
	}

	public void setUser(MyUserEntity user) {
		this.user = user;
	}
	
	

}
